<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get collation attribute value</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="collator.create.html">Collator::create</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="collator.geterrorcode.html">Collator::getErrorCode</a></div>
 <div class="up"><a href="class.collator.html">Collator</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="collator.getattribute" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Collator::getAttribute</h1>
  <h1 class="refname">collator_get_attribute</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PECL intl &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">Collator::getAttribute</span> -- <span class="refname">collator_get_attribute</span> &mdash; <span class="dc-title">Get collation attribute value</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-collator.getattribute-description">
  <h3 class="title">说明</h3>
  <p class="para">
   面向对象风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">int</span> 
   <span class="methodname"><strong>Collator::getAttribute</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$attr</code></span>
   )</div>

  <p class="para rdfs-comment">
   过程化风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> 
   <span class="methodname"><strong>collator_get_attribute</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.collator.html" class="type Collator">Collator</a></span> <code class="parameter">$coll</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$attr</code></span>
   )</div>

  <p class="para rdfs-comment">
   Get a value of an integer collator attribute.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-collator.getattribute-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">coll</code></em></dt>

     <dd>

      <p class="para">
       <a href="class.collator.html" class="classname">Collator</a> object.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">attr</code></em></dt>

     <dd>

      <p class="para">
       Attribute to get value for.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>



 <div class="refsect1 returnvalues" id="refsect1-collator.getattribute-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Attribute value, or <span class="type"><a href="language.types.boolean.html" class="type boolean">boolean</a></span> <strong><code>FALSE</code></strong> on error.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-collator.getattribute-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2427">
    <p><strong>Example #1 <span class="function"><strong>collator_get_attribute()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$coll&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">collator_create</span><span style="color: #007700">(&nbsp;</span><span style="color: #DD0000">'en_CA'&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$val&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">collator_get_attribute</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$coll</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Collator</span><span style="color: #007700">::</span><span style="color: #0000BB">NUMERIC_COLLATION&nbsp;</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #0000BB">$val&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">false&nbsp;</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Handle&nbsp;error.<br /></span><span style="color: #007700">}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-collator.getattribute-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><a href="class.collator.html#intl.collator-constants" class="link"><a href="class.collator.html" class="classname">Collator</a> constants</a></li>
    <li class="member"><span class="function"><a href="collator.setattribute.html" class="function" rel="rdfs-seeAlso">collator_set_attribute()</a> - Set collation attribute</span></li>
    <li class="member"><span class="function"><a href="collator.getstrength.html" class="function" rel="rdfs-seeAlso">collator_get_strength()</a> - Get current collation strength</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="collator.create.html">Collator::create</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="collator.geterrorcode.html">Collator::getErrorCode</a></div>
 <div class="up"><a href="class.collator.html">Collator</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
